<template>
  <div class="homepage-container">
    <header class="main-header">
      <div class="logo-container">
        <img src="https://web-sui.oss-cn-hangzhou.aliyuncs.com/ef840c64-a2b7-4965-865d-db1f24c3c269.png" alt="Logo" class="header-logo">
        <span>慧医数字医疗应用系统</span>
      </div>
      <nav>
        <button class="login-button" @click="$emit('show-login')">登录</button>
      </nav>
    </header>
    
    <main class="hero-section">
      <div class="hero-content">
        <h1 class="hero-title">引领数字医疗新时代</h1>
        <p class="hero-subtitle">智能、精准、关怀，我们致力于提供最卓越的医疗解决方案</p>
        <div class="hero-buttons">
          <button class="primary-btn" @click="$emit('show-login')">立即体验</button>
          <button class="secondary-btn" @click="scrollToFeatures">了解更多</button>
        </div>
      </div>
      <div class="hero-image">
        <div class="floating-card card1">
          <div class="card-icon">🏥</div>
          <div class="card-text">智能管理</div>
        </div>
        <div class="floating-card card2">
          <div class="card-icon">⚡</div>
          <div class="card-text">高效运营</div>
        </div>
        <div class="floating-card card3">
          <div class="card-icon">🔒</div>
          <div class="card-text">安全可靠</div>
        </div>
      </div>
    </main>

    <section class="features-section">
      <h2 class="section-title">核心功能</h2>
      <div class="features-grid">
        <div class="feature-card">
          <div class="feature-icon">👨‍⚕️</div>
          <h3>医师管理</h3>
          <p>全面的医师信息管理，支持级别分类和诊治类别管理</p>
        </div>
        <div class="feature-card">
          <div class="feature-icon">🏢</div>
          <h3>公司管理</h3>
          <p>医药公司信息管理，包含公司政策和类别分类</p>
        </div>
        <div class="feature-card">
          <div class="feature-icon">💊</div>
          <h3>药品管理</h3>
          <p>药品信息管理，价格监控和分类管理</p>
        </div>
        <div class="feature-card">
          <div class="feature-icon">📍</div>
          <h3>药店管理</h3>
          <p>销售地点管理，药店信息维护</p>
        </div>
        <div class="feature-card">
          <div class="feature-icon">📋</div>
          <h3>材料管理</h3>
          <p>必备材料管理，文档和资料整理</p>
        </div>
        <div class="feature-card">
          <div class="feature-icon">⚙️</div>
          <h3>类别 </h3>
          <p>类别管理，支持各类别自定义配置</p>
        </div>
      </div>
    </section>

    <section class="stats-section">
      <div class="stats-container">
        <div class="stat-item">
          <div class="stat-number">NEFU</div>
          <div class="stat-label"></div>
        </div>
        <div class="stat-item">
          <div class="stat-number">CCEC</div>
          <div class="stat-label"></div>
        </div>
        <div class="stat-item">
          <div class="stat-number">2025</div>
          <div class="stat-label"></div>
        </div>

      </div>
    </section>

    <footer class="footer">
      <p>&copy; 2025 慧医数字医疗应用系统. 保留所有权利.</p>
    </footer>
  </div>
</template>

<script setup>
defineEmits(['show-login']);

// 平滑滚动到核心功能区
function scrollToFeatures() {
  const el = document.querySelector('.features-section');
  if (el) {
    el.scrollIntoView({ behavior: 'smooth' });
  }
}
</script>

<style scoped>
.homepage-container {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); 
  position: relative;
  overflow-x: hidden;
  margin: 0;
  padding: 0;
}

.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 40px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  width: 100%;
  box-sizing: border-box;
}

.logo-container {
  display: flex;
  align-items: center;
  font-size: 1.4rem;
  font-weight: 700;
  color: #333;
}

.header-logo {
  width: 59px;
  height: 57px;
  margin-right: 15px;
  border-radius: 10px;
}

.login-button {
  padding: 12px 24px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 25px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.login-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.hero-section {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 120px 60px 200px;
  position: relative;
  width: 100%;
  box-sizing: border-box;
  min-height: calc(100vh - 80px);
}

.hero-content {
  flex: 1;
  max-width: 600px;
  color: white;
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 800;
  margin-bottom: 20px;
  line-height: 1.2;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.hero-subtitle {
  font-size: 1.3rem;
  margin-bottom: 40px;
  opacity: 0.9;
  line-height: 1.6;
}

.hero-buttons {
  display: flex;
  gap: 20px;
}

.primary-btn, .secondary-btn {
  padding: 15px 30px;
  border: none;
  border-radius: 30px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.primary-btn {
  background: white;
  color: #667eea;
  box-shadow: 0 4px 15px rgba(255, 255, 255, 0.3);
}

.primary-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 25px rgba(255, 255, 255, 0.4);
}

.secondary-btn {
  background: transparent;
  color: white;
  border: 2px solid white;
}

.secondary-btn:hover {
  background: white;
  color: #667eea;
  transform: translateY(-3px);
}

.hero-image {
  flex: 1;
  position: relative;
  height: 400px;
}

.floating-card {
  position: absolute;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 15px;
  padding: 20px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  animation: float 6s ease-in-out infinite;
}

.card1 {
  top: 20%;
  right: 20%;
  animation-delay: 0s;
}

.card2 {
  top: 50%;
  right: 10%;
  animation-delay: 2s;
}

.card3 {
  top: 80%;
  right: 30%;
  animation-delay: 4s;
}

.card-icon {
  font-size: 2rem;
  margin-bottom: 10px;
}

.card-text {
  font-weight: 600;
  color: #333;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-20px); }
}

.features-section {
  padding: 100px 60px;
  background: white;
  width: 100%;
  box-sizing: border-box;
}

.section-title {
  text-align: center;
  font-size: 2.5rem;
  font-weight: 700;
  color: #333;
  margin-bottom: 60px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  max-width: 1200px;
  margin: 0 auto;
}

.feature-card {
  background: white;
  padding: 40px 30px;
  border-radius: 20px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  border: 1px solid #f0f0f0;
}

.feature-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.feature-icon {
  font-size: 3rem;
  margin-bottom: 20px;
}

.feature-card h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 15px;
}

.feature-card p {
  color: #666;
  line-height: 1.6;
}

.stats-section {
  padding: 80px 60px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  width: 100%;
  box-sizing: border-box;
}

.stats-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 40px;
  max-width: 1000px;
  margin: 0 auto;
}

.stat-item {
  text-align: center;
}

.stat-number {
  font-size: 4rem;
  font-weight: 800;
  margin-bottom: 10px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.stat-label {
  font-size: 1.2rem;
  opacity: 0.9;
}

.footer {
  padding: 30px;
  background: #333;
  color: white;
  text-align: center;
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .homepage-container {
    width: 100%;
  }
  
  .main-header {
    padding: 15px 20px;
  }
  
  .hero-section {
    flex-direction: column;
    padding: 100px 30px 60px;
    text-align: center;
    min-height: calc(100vh - 60px);
  }
  
  .hero-title {
    font-size: 2.5rem;
  }
  
  .hero-buttons {
    justify-content: center;
  }
  
  .features-section {
    padding: 60px 30px;
  }
  
  .stats-section {
    padding: 60px 30px;
  }
  
  .features-grid {
    grid-template-columns: 1fr;
  }
  
  .stats-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .main-header {
    padding: 10px 15px;
  }
  
  .logo-container {
    font-size: 1.1rem;
  }
  
  .header-logo {
    width: 35px;
    height: 35px;
    margin-right: 10px;
  }
  
  .hero-section {
    padding: 80px 20px 40px;
  }
  
  .hero-title {
    font-size: 2rem;
  }
  
  .hero-subtitle {
    font-size: 1.1rem;
  }
  
  .features-section {
    padding: 40px 20px;
  }
  
  .stats-section {
    padding: 40px 20px;
  }
  
  .section-title {
    font-size: 2rem;
  }
  
  .feature-card {
    padding: 30px 20px;
  }
  
  .stats-container {
    grid-template-columns: 1fr;
    gap: 30px;
  }
}
</style> 